package com.design.pattern.factorymethod;

import com.design.pattern.factorymethod.factory.BMWFactory;
import com.design.pattern.factorymethod.factory.BenZFactory;
import com.design.pattern.factorymethod.factory.Factory;
import com.design.pattern.factorymethod.product.Car;

/**
 * Created by Administrator on 2016/5/17.
 */
public class Boss {
    public static void main(String[] args) {
        //产生一个宝马工厂
        Factory bmwFactory = new BMWFactory();
        //宝马工厂生产一辆宝马汽车
        Car bmw = bmwFactory.createCar("BMW 450");
        bmw.drive();

        //产生一个奔驰工厂
        Factory benzFactory = new BenZFactory();
        //奔驰工厂生产一辆奔驰汽车
        Car benZ = benzFactory.createCar("Benz B200");
        benZ.drive();

    }
}
